package permissaoUsuario;
// Generated 21/08/2011 22:49:20 by Hibernate Tools 3.2.1.GA


import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import permissao.Permissao;
import login.Login;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * PermissaoUsuario generated by hbm2java
 */
@Entity
@Table(name="permissao_usuario"
    ,schema="public"
)
public class PermissaoUsuario  implements java.io.Serializable {


     private int idPremissaoUsuario;
     private Permissao permissao;
     private Login login;

    public PermissaoUsuario() {
    }

    public PermissaoUsuario(int idPremissaoUsuario, Permissao permissao, Login login) {
       this.idPremissaoUsuario = idPremissaoUsuario;
       this.permissao = permissao;
       this.login = login;
    }
   
    @Id 
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name="id_permissao_usuario", unique=true, nullable=false)
    public int getIdPremissaoUsuario() {
        return this.idPremissaoUsuario;
    }
    
    public void setIdPremissaoUsuario(int idPremissaoUsuario) {
        this.idPremissaoUsuario = idPremissaoUsuario;
    }
    @ManyToOne(fetch=FetchType.EAGER)
    @JoinColumn(name="id_permissao", nullable=false)
    public Permissao getPermissao() {
        return this.permissao;
    }
    
    public void setPermissao(Permissao permissao) {
        this.permissao = permissao;
    }
    
    @ManyToOne(fetch=FetchType.EAGER)
    @JoinColumn(name="id_login", nullable=false)
    public Login getLogin() {
        return this.login;
    }
    
    public void setLogin(Login login) {
        this.login = login;
    }

}